package com.example.bill;

import android.os.Bundle;
import android.os.Looper;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.RadioGroup;
import android.widget.Spinner;
import android.widget.TextView;
import android.widget.Toast;

import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;
import androidx.viewpager.widget.ViewPager;

import com.example.bill.adapter.MainPageFragmentAdapter;
import com.example.bill.adapter.MonthDayAdapter;
import com.example.bill.application.BillApplication;
import com.example.bill.entity.Memo;
import com.example.bill.repository.MemoRepository;
import com.example.bill.sys.ChoreographerHelper;
import com.example.bill.sys.LooperPrinter;

import java.sql.Date;
import java.time.LocalDateTime;
import java.time.ZoneId;

public class MainActivity extends AppCompatActivity {

    private MemoRepository dataBase;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

//        Looper.getMainLooper().setMessageLogging(new LooperPrinter());

        new ChoreographerHelper().run();

        EdgeToEdge.enable(this);
        setContentView(R.layout.activity_main);
        ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> {
            Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars());
            v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
            return insets;
        });

        ViewPager viewPager = findViewById(R.id.viewPager);

        viewPager.setAdapter(new MainPageFragmentAdapter(getSupportFragmentManager()));
    }
}